{include file="Public:header2"/}
<body>
<body style="min-height: 100%;background-color: #fff">
<div style="padding: 0 20px;position: relative;z-index: 99;border-bottom: 1px solid #e5e5e5;line-height: 39px;height: 39px;overflow: hidden;">
      <span style="visibility: visible;">
        <a href="{:url('/admin/productorder')}" style="padding-right: 8px;line-height: 22px;font-size: 14px;color: #333!important;">订单列表<span class="layui-box">&gt;</span></a>
        <a href="javascript:;"> <cite>订单详情</cite></a>
      </span>
</div>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <table class="layui-table">
                <thead>
                    <tr>
                        <th id="ddd" style="text-align:center" colspan="9">订单信息</th>
                    </tr>
                </thead>
                <tbody>
                <tr>
                    <td>订单号</td>
                    <td>下单账户</td>
                    <td>收货姓名</td>
                    <td>收货手机号</td>
                    <td colspan="2">收货地址</td>
                    <td>订单状态</td>
                    <td>下单时间</td>
                </tr>
                </tbody>
                <tbody>
                    <tr>
                        <td>{$orderlist.order_num}</td>
                        <td>{$orderlist.user_mobile}</td>
                        <td>{$orderlist.name}</td>
                        <td>{$orderlist.mobile}</td>
                        <td  colspan="2">{$orderlist.province}-{$orderlist.city}-{$orderlist.county}-{$orderlist.address}</td>
                        <td>
                            {if condition="$orderlist['status'] eq 1"}
                                待确认
                            {elseif condition="$orderlist['status'] eq 2" /}
                                待发货
                            {elseif condition="$orderlist['status'] eq 3" /}
                                待收货
                            {elseif condition="$orderlist['status'] eq 4" /}
                                已完成
                            {elseif condition="$orderlist['status'] eq 5" /}
                                已取消
                            {/if}
                        </td>
                        <td>{$orderlist.addtime|date="Y-m-d"}</td>
                    </tr>
                </tbody>
            <thead>
                <tr>
                    <th colspan='9' style="height:15px;text-align:center;background:#fff">商品信息</th>
                </tr>
            <tr>
                <th colspan='2'>商品名称</th>
                <th colspan='2'>商品图片</th>
                <th colspan='1'>商品价格</th>
                <th colspan='1'>商品数量</th>
                <th colspan='1'>商品规格</th>
                <th colspan='1'>商品来源</th>
            </tr>
            </thead>
            <tbody>
                {volist name="product" id="vo"}
                    <tr style="text-align:center">
                        <td colspan='2'>{$vo['title']}</td>
                        <td colspan='2'><img src="{php} echo imageUrl($vo['imgurl']) {/php}" width="60px" height="60px"></td>
                        <td colspan='1'>{$vo['price']}</td>
                        <td colspan='1'>x {$vo['num']}</td>
                        <td colspan='1'>
                            {volist name="vo['sku']" id="voo"}
                                {$voo}<br />
                            {/volist}
                        </td>
                        <td colspan='1'>
                            {if condition="$vo['order_type'] eq 1"}
                                商城商品
                            {elseif condition="$vo['order_type'] eq 2" /}
                                盲盒商品
                            {/if}
                        </td>
                    </tr>
                {/volist}
                {if condition="$orderlist['status'] eq 2"}
                <tr colspan="9">
                    <td colspan='9' style="height:40px;text-align:center;">
                        <button type="button" onclick="fa({$orderlist['id']})" class="layui-btn">点击派发</button>
                    </td>
                </tr>
                {/if}
            </tbody>
            {if condition="in_array($orderlist['status'],array(3,4))"}
            <thead>
                <tr>
                    <td colspan='9' style="height:15px;text-align:center;background:#fff">物流信息</td>
                </tr>
            <tr>
                <th colspan='2'>快递名称</th>
                <th colspan='2'>快递单号</th>
                <th colspan='5'>发货时间</th>
            </tr>
            </thead>
            <tbody>
                    <tr style="text-align:center">
                        <td colspan='2'>{$orderlist['courier_name']}</td>
                        <td colspan='2'>{$orderlist['courier_number']}</td>
                        <td colspan='5'>{if condition="$orderlist['fa_time'] gt 0"}{$orderlist.fa_time|date="Y-m-d H:i:s"}{else /}----{/if}</td>
                    </tr>
                {if condition="$orderlist['status'] eq 3"}
                <tr colspan="10">
                    <td colspan='10' style="height:40px;text-align:center;">
                        <!-- <button type="button" onclick="over({$orderlist['id']})" class="layui-btn">点击签收</button> -->
                    </td>
                </tr>
                {/if}
            </tbody>
            {/if}
            </table>
        </div>
    </div>
</div>
{include file="Public:footer"/}
<script type="text/javascript">
    layui.use(['table'], function(){

    });

    function fa(id){
        layer.open({
          type: 2,
          title: '发货信息',
          shadeClose: true,
          shade: 0.8,
          area: ['600px', '400px'],
          content: "/admin/productordersend/id/"+id //iframe的url
        });
    }
    function over(id){
        var url="{:url('/admin/over')}";
        var load=layer.load(2);
        $.post(url,{"id":id},function(data){
            if(data.status==1){
                    layer.msg(data.msg,{icon:1,time:1500},function(){
                         location.reload();
                    });
                }else{
                    layer.msg(data.msg,{icon:2,time:1500});
                    layer.close(load);
                }
        })
    }
    function order_confirm(id){
        var $ = layui.$;
        layer.confirm('请确认收到货款后操作',function(){
            var url="{:url('/admin/productorderconfirm')}";
            var load=layer.load(2);
            $.post(url,{"id":id},function(data){
                if(data.status==1){
                    layer.msg(data.msg,{icon:1,time:1500},function(){
                             location.reload();
                        });
                }else{
                    layer.msg(data.msg,{icon:2,time:1500});
                    layer.close(load);
                }
            })
        })
    }
</script>
</body>
</html>


